﻿@model Telecom.Data.ROLES
@{  AjaxOptions ajaxOpts = new AjaxOptions
    {
        HttpMethod = "post",
        OnComplete = "completedAjaxRequestROLES"
    };
}




@using (Ajax.BeginForm("AddUpdateRoles", "PhanQuyen", null, ajaxOpts, new { enctype = "multipart/form-data" }))
{
    <div id="content_load_mast">
        <div class="NoticeBox css_table_form">
            @Html.HiddenFor(model => model.ROLEID, new {})
            <table class="css_form">
                <tr style="margin-bottom:20px">
                    <td>Tên Roles:</td>
                    <td>@Html.TextBoxFor(model => model.TEN, new {})</td>
                </tr>
                <tr style="margin-bottom:20px">
                    <td>Ghi chú:</td>
                    <td>@Html.TextBoxFor(model => model.GHICHU, new {})</td>
                </tr>
            </table>
        </div>
        
        <div class="footer_submit" style="text-align:center; padding-bottom:0px">
            <div class="warning-area"></div>
            <button type="submit" onclick="return makeloading('content_load_mast');" >
                <span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">Cập nhật</span><span class="l-btn-icon icon-add">&nbsp;</span></span></button>
            <button type="button" onclick="return close_window_elements('window_Edit_ROLES');">
                <span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">Hủy bỏ</span><span class="l-btn-icon icon-remove">&nbsp;</span></span></button>
        </div>
    </div>
}

<script type="text/javascript">

    function completedAjaxRequestROLES(obj) {

        var returnObj = eval('(' + obj.responseText + ')');

        if (returnObj.Status == "success") {

            $('#Roles_TableContainer').datagrid('reload');
            $("#content_load_mast").unmask();
            close_window_elements('window_Edit_ROLES');

        } else {
            $("#content_load_mast").unmask();
            confirmOptionNormal(returnObj.Message);
        }

        return false;
    }

</script>